<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function camelize(str = "") {
        let r = "";
        for (let i = 0; i < str.length; i++) {
          if (str[i] === "-") {
            r += str[i + 1].toUpperCase();
            i++;
          } else {
            r += str[i];
          }
        }
        console.log(r);
      }
      camelize("background-color"); //"backgroundColor";
      camelize("list-style-image"); //"listStyleImage";
      camelize("-webkit-transition"); //"WebkitTransition";
    </script>
  </body>
</html>
